﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BlogsAPI.Sites.FoursquareSharp
{
    /// <summary>
    /// As a field on another object (e.g., checkin, photo, tip), we return a "mini" user that has a small subset of fields.
    /// </summary>
    /// <see cref="https://developer.foursquare.com/docs/responses/user.html"/>
    public class User
    {
        /// <summary>
        /// Аватарка пользователя
        /// </summary>
        /// <param name="size">размер, полтко у него фиксированные диапазоны</param>
        /// <returns></returns>
        public string GetAvatar(string size="64x64")
        {
            if (Photo == null||String.IsNullOrEmpty(Photo.Prefix)||String.IsNullOrEmpty(Photo.Suffix)) return String.Empty;
            return String.Format("{0}{1}{2}",Photo.Prefix,size,Photo.Suffix);
        }

        /// <summary>
        /// A unique identifier for this user.
        /// </summary>
        [JsonMapping("id", JsonMapping.MappingType.Primitive)]
        public long Id { get; set; }
        /// <summary>
        /// A user's first name.
        /// </summary>
        [JsonMapping("canonicalUrl", JsonMapping.MappingType.Primitive)]
        public string CanonicalUrl { get; set; }
        /// <summary>
        /// URI
        /// </summary>
        [JsonMapping("firstName", JsonMapping.MappingType.Primitive)]
        public string FirstName { get; set; }
        /// <summary>
        /// A user's last name.
        /// </summary>
        [JsonMapping("lastName", JsonMapping.MappingType.Primitive)]
        public string LastName { get; set; }
        /// <summary>
        /// Contains prefix and suffix, similar to the format for photo. Accepted sizes are 36x36, 100x100, 300x300, and 500x500.
        /// </summary>
        [JsonMapping("photo", JsonMapping.MappingType.Class)]
        public Photo Photo { get; set; }
        /// <summary>
        /// male/female
        /// </summary>
        [JsonMapping("gender", JsonMapping.MappingType.Primitive)]
        public string Gender { get; set; }
        //relationship
        //friends
        //type
        //venue
    }
}
